<!-- 筛选组件 -->
<template>
    <div>
        <el-form label-width="100px" class="filter_box">
            <div class="filter_box_con">
                <el-row v-if="this.templateSource == 'matchingQuote'">
                    <el-form-item label="关键字搜索">
                        <el-col :span="8" class="bill_price_tem match_quote_keyword keyword_int_height">
                            <el-input v-model="filterModel.acceptor_name" clearable @clear="clearKeyword" placeholder="输入承兑人关键字，如: 兴业，招商，农业"></el-input><el-button type="primary" size="small" @click="searchKeyword()">搜索</el-button>
                        </el-col>
                    </el-form-item>
                </el-row>
                <el-form-item label="统计时间" class="nowrap my_bill_form my_bill_form_one" v-if="this.templateSource == 'billQuery' || this.templateSource == 'orderQuery'">
                    <el-radio-group v-model="filterModel.checkTime" size="small" @change="changecheckTime()" class="bill_price">
                        <el-radio-button v-for="item in checkTimeTypesOption" :label="item.key" :key="item.key">
                            <span v-if="item.key === ''">不限</span>
                            <span v-if="item.key !== ''">
                            {{item.label}}
                        </span>
                        </el-radio-button>
                    </el-radio-group>
                    <div size="small" class="ready_bill_price"
                         :class="{is_active: isInputTimeCheck}">
                        [ <el-input type="number" v-model="filterModel.trem_checkTime.minTimeCheck" placeholder="最小"></el-input>天,
                        <el-input type="number" v-model="filterModel.trem_checkTime.maxTimeCheck" placeholder="最大"></el-input>天 ]
                    </div>
                    <el-button type="primary" size="small"
                               v-if="filterModel.trem_checkTime.minTimeCheck != '' && filterModel.trem_checkTime.maxTimeCheck != ''"
                               @click="confirmCheckTime()">
                        确定
                    </el-button>
                </el-form-item>
                <el-form-item label="票据来源" v-if="this.templateSource == 'matchingQuote' || this.templateSource == 'billCheck'">
                    <el-radio-group v-model="filterModel.billSource" size="small" @change="changeSource(filterModel.billSource)">
                        <el-radio-button v-for="item in billSourceOptions" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票据来源" v-if="this.templateSource == 'billQuery'">
                    <el-radio-group v-model="filterModel.billSource" size="small" @change="changeSource(filterModel.billSource)">
                        <el-radio-button v-for="item in queryBillSourceTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="买卖角色" v-if="this.templateSource == 'orderManage' && this.templateState != 'confirming'">
                    <el-radio-group v-model="filterModel.orderRole" size="small" @change="changeOrderRole(filterModel.orderRole)">
                        <el-radio-button v-for="item in roleOptions" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="订单来源" v-if="this.templateSource == 'orderManage'">
                    <el-radio-group v-model="filterModel.orderSource" size="small" @change="changeOrderSource(filterModel.orderSource)">
                        <el-radio-button v-for="item in orderSourceOptions" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票据类型" v-if="this.templateSource == 'wantBill'">
                    <el-radio-group v-model="filterModel.billTypeId" size="small" @change="changeBillTypeId(filterModel.billTypeId)">
                        <el-radio-button v-for="item in billTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票面金额" v-if="this.templateSource == 'wantBill'">
                    <el-col :span="8" class="bill_price_tem want_bill_wanyuan_icon want_bill_price_choose_int_width">
                        <el-input type="text"
                                  v-model="filterModel.billSumPrice"
                                  placeholder="请输入票面金额"
                                  @input="changePrice()"
                                  class="bill_int"
                                  suffix-icon="iconfont icon-wanyuan"
                                  clearable @clear="clearPriceInt"
                        ></el-input> &#X3000;<el-button type="primary" size="small" @click="searchPriceInt()">搜索</el-button>
                    </el-col>
                </el-form-item>
                <el-form-item label="到期日期" v-if="this.templateSource == 'wantBill'">
                    <el-col :span="6">
                        <el-date-picker
                                v-model="filterModel.deadlineDays"
                                type="date"
                                placeholder="选择日期"
                                class="full-width bill_price_tem bill_int"
                                :picker-options="pickerOptions"
                                value-format="yyyy-MM-dd"
                                @change="changeDate()">
                        </el-date-picker>
                    </el-col>
                </el-form-item>
                <el-form-item label="渠道代理" v-if="this.templateSource == 'orderQuery' || this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.channelAgent" size="small" @change="changeChannelAgent(filterModel.channelAgent)"
                                    :disabled="this.templateSource == 'memberQuery' && filterModel.registerStage == '1' || filterModel.memberTypeId == '2'">
                        <el-radio-button v-for="item in channelAgentOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="承兑机构" v-if="this.templateSource != 'memberQuery' && this.templateSource != 'orderManage' && this.templateSource != 'billCheck' && this.templateSource != 'billQuery'">
                    <el-checkbox-group v-model="acceptorTypeArr" size="small" @change="changeCheckboxFilter(acceptorTypeArr)">
                        <el-checkbox-button v-for="item in acceptOptions" :label="item.key" :key="item.key">{{item.label}}</el-checkbox-button>
                    </el-checkbox-group>
                </el-form-item>

                <el-form-item label="承兑机构" v-if="this.templateSource == 'billCheck' || this.templateSource == 'billQuery'">
                    <el-checkbox-group v-model="acceptorTypeArr" size="small" @change="changeCheckboxFilter(acceptorTypeArr)">
                        <el-checkbox-button v-for="item in billAcceptorTypesOptions" :label="item.key" :key="item.key">{{item.label}}</el-checkbox-button>
                    </el-checkbox-group>
                </el-form-item>

                <el-form-item label="会员类型" v-if="this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.memberTypeId" size="small" @change="changeMemberTypeId(filterModel.memberTypeId)">
                        <el-radio-button v-for="item in memberTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="注册阶段" v-if="this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.registerStage" size="small" @change="changeRegisterStage(filterModel.registerStage)"
                                    :disabled="filterModel.memberTypeId == '2'">
                        <el-radio-button v-for="item in registerStageTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="账户类型" v-if="this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.isXingyeAccount" size="small" @change="changeIsXingyeAccount(filterModel.isXingyeAccount)"
                                    :disabled="filterModel.registerStage == '1' || filterModel.registerStage == '2' || filterModel.registerStage == '3' || filterModel.registerStage == '4' || filterModel.memberTypeId == '2'">
                        <el-radio-button v-for="item in isXingyeAccountTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票面金额" class="nowrap my_bill_form"
                              v-if="this.templateSource == 'matchingQuote' || this.templateSource == 'billCheck' || this.templateSource == 'orderQuery' || this.templateSource == 'billQuery'">
                    <el-radio-group v-model="filterModel.billPrice" size="small" @change="changePrice()" class="bill_price">
                        <el-radio-button v-for="item in billPriceOption" :label="item.key" :key="item.key">
                            <span v-if="item.key === ''">不限</span>
                            <span v-if="item.key !== ''">
                                                {{item.gtoe ? '[' : '('}}{{item.billPriceMin}}万,{{item.billPriceMax}}万{{item.ltoe ? ']' : ')'}}
                                            </span>
                        </el-radio-button>
                    </el-radio-group>
                    <div size="small" class="ready_bill_price"
                         :class="{is_active: isInputPrice}">
                        [ <el-input type="number" v-model="filterModel.trem_billPrice.minPrice" placeholder="最小"></el-input>万,
                        <el-input type="number" v-model="filterModel.trem_billPrice.maxPrice" placeholder="最大"></el-input>万 ]
                    </div>
                    <el-button type="primary" size="small"
                               v-if="filterModel.trem_billPrice.minPrice != '' && filterModel.trem_billPrice.maxPrice != ''"
                               @click="confirmPrice()">
                        确定
                    </el-button>
                    <!--<el-button type="info" size="small"-->
                               <!--v-if="filterModel.trem_billPrice.minPrice != '' && filterModel.trem_billPrice.maxPrice != ''"-->
                               <!--@click="clearPrice()">-->
                        <!--清空-->
                    <!--</el-button>-->
                </el-form-item>
                <el-form-item label="到期天数" class="nowrap my_bill_form"
                              v-if="this.templateSource == 'matchingQuote' || this.templateSource == 'billCheck' || this.templateSource == 'orderQuery' || this.templateSource == 'billQuery'">
                    <el-radio-group v-model="filterModel.deadTime" size="small" @change="changeTime()" class="bill_price">
                        <el-radio-button v-for="item in deadTimeOption" :label="item.key" :key="item.key">
                            <span v-if="item.key === ''">不限</span>
                            <span v-if="item.key !== ''">
                                                {{item.gtoe ? '[' : '('}}{{item.expiresDayMin}}天,{{item.expiresDayMax}}天{{item.ltoe ? ']' : ')'}}
                                            </span>
                        </el-radio-button>
                    </el-radio-group>
                    <div size="small" class="ready_bill_price"
                         :class="{is_active: isInputTime}">
                        [ <el-input type="number" v-model="filterModel.trem_deadTime.minTime" placeholder="最小"></el-input>天,
                        <el-input type="number" v-model="filterModel.trem_deadTime.maxTime" placeholder="最大"></el-input>天 ]
                    </div>
                    <el-button type="primary" size="small"
                               v-if="filterModel.trem_deadTime.minTime != '' && filterModel.trem_deadTime.maxTime != ''"
                               @click="confirmDays()">
                        确定
                    </el-button>
                    <!--<el-button type="info" size="small"-->
                               <!--v-if="filterModel.trem_deadTime.minTime != '' && filterModel.trem_deadTime.maxTime != ''"-->
                               <!--@click="clearTime()">-->
                        <!--清空-->
                    <!--</el-button>-->
                </el-form-item>
                <el-form-item label="业务员归属" v-if="this.templateSource == 'orderQuery'">
                    <el-radio-group v-model="filterModel.salesmanAffiliation" size="small" @change="changeChannelAgent(filterModel.salesmanAffiliation)">
                        <el-radio-button v-for="item in salesmanAffiliationTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <!--<el-form-item label="订单处理员" v-if="this.templateSource == 'orderQuery'">-->
                    <!--<el-radio-group v-model="filterModel.userId" size="small" @change="changeUserId(filterModel.userId)">-->
                        <!--<el-radio-button v-for="item in checkServerOption" :label="item.id" :key="item.id">{{item.username}}</el-radio-button>-->
                    <!--</el-radio-group>-->
                <!--</el-form-item>-->
                <el-form-item label="支付方" v-if="this.templateSource == 'orderQuery'">
                    <el-radio-group v-model="filterModel.billStyleId" size="small" @change="changePayer(filterModel.billStyleId)">
                        <el-radio-button v-for="item in payerTypesOptions" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票据状态" v-if="this.templateSource == 'orderQuery'">
                    <el-radio-group v-model="filterModel.orderStatusId" size="small" @change="changeOrderStatusId(filterModel.orderStatusId)">
                        <el-radio-button v-for="item in orderStatusTypesOptions" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票据状态" v-if="this.templateSource == 'billQuery'">
                    <el-radio-group v-model="filterModel.billStatusQuery" size="small" @change="changeBillStatusQuery(filterModel.billStatusQuery)">
                        <el-radio-button v-for="item in billQueryBillSatausTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="审核状态" v-if="this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.checkStatus" size="small" @change="changeCheckStatus(filterModel.checkStatus)"
                                    :disabled="filterModel.memberTypeId == '1' && (filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.registerStage == '5')">
                        <el-radio-button v-for="item in checkStatusTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="审核客服" v-if="this.templateSource == 'memberQuery' || this.templateSource == 'billQuery'">
                    <el-radio-group v-model="filterModel.userId" size="small" @change="changeUserId(filterModel.userId)"
                                    :disabled="this.templateSource == 'memberQuery' && (filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.memberTypeId == '2')">
                        <el-radio-button v-for="item in checkServerOption" :label="item.id" :key="item.id">{{item.username}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>

                <el-form-item label="审核时长" class="nowrap my_bill_form" v-if="this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.checkMinute" size="small" @change="changeCheckMinutes()" class="bill_price"
                                    :disabled="filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.registerStage == '5' || filterModel.memberTypeId == '2'">
                        <el-radio-button v-for="item in checkMinutesTypesOption" :label="item.key" :key="item.key">
                            <span v-if="item.key === ''">不限</span>
                            <span v-if="item.key !== ''">
                            {{item.label}}
                        </span>
                        </el-radio-button>
                    </el-radio-group>
                    <div size="small" class="ready_bill_price"
                         :class="{is_active: isInputMinutesCheck}">
                        [ <el-input type="number" v-model="filterModel.trem_checkMinutes.minMinutesCheck" placeholder="最小" :disabled="filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.registerStage == '5' || filterModel.memberTypeId == '2'"></el-input>分,
                        <el-input type="number" v-model="filterModel.trem_checkMinutes.maxMinutesCheck" placeholder="最大" :disabled="filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.registerStage == '5' || filterModel.memberTypeId == '2'"></el-input>分 ]
                    </div>
                    <el-button type="primary" size="small"
                               v-if="filterModel.trem_checkMinutes.minMinutesCheck != '' && filterModel.trem_checkMinutes.maxMinutesCheck != ''"
                               @click="confirmCheckMinutes()">
                        确定
                    </el-button>
                </el-form-item>
                <el-form-item label="创建时间" class="nowrap my_bill_form" v-if="this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.createMinute" size="small" @change="changeCreateMinutes()" class="bill_price"
                                    :disabled="filterModel.registerStage == '1'">
                        <el-radio-button v-for="item in createMinutesTypesOption" :label="item.key" :key="item.key">
                            <span v-if="item.key === ''">不限</span>
                            <span v-if="item.key !== ''">
                            {{item.label}}
                        </span>
                        </el-radio-button>
                    </el-radio-group>
                    <div size="small" class="ready_bill_price"
                         :class="{is_active: isInputMinutesCreate}">
                        [ <el-input type="number" v-model="filterModel.trem_createMinutes.minMinutesCreate" placeholder="最小" :disabled="filterModel.registerStage == '1'"></el-input>天,
                        <el-input type="number" v-model="filterModel.trem_createMinutes.maxMinutesCreate" placeholder="最大" :disabled="filterModel.registerStage == '1'"></el-input>天 ]
                    </div>
                    <el-button type="primary" size="small"
                               v-if="filterModel.trem_createMinutes.minMinutesCreate != '' && filterModel.trem_createMinutes.maxMinutesCreate != ''"
                               @click="confirmCreateMinutes()">
                        确定
                    </el-button>
                </el-form-item>
                <el-form-item label="审核时间" class="nowrap my_bill_form" v-if="this.templateSource == 'memberQuery'">
                    <el-radio-group v-model="filterModel.checkMemberTime" size="small" @change="changeCheckMemberTimes()" class="bill_price"
                                    :disabled="filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.memberTypeId == '2'">
                        <el-radio-button v-for="item in createMinutesTypesOption" :label="item.key" :key="item.key">
                            <span v-if="item.key === ''">不限</span>
                            <span v-if="item.key !== ''">
                            {{item.label}}
                        </span>
                        </el-radio-button>
                    </el-radio-group>
                    <div size="small" class="ready_bill_price"
                         :class="{is_active: isInputCheckMemberTime}">
                        [ <el-input type="number" v-model="filterModel.trem_checkMemberTimes.minCheckMemberTime" placeholder="最小" :disabled="filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.registerStage == '5' || filterModel.memberTypeId == '2'"></el-input>天,
                        <el-input type="number" v-model="filterModel.trem_checkMemberTimes.maxCheckMemberTime" placeholder="最大" :disabled="filterModel.registerStage == '1' || filterModel.registerStage == '4' || filterModel.registerStage == '5' || filterModel.memberTypeId == '2'"></el-input>天 ]
                    </div>
                    <el-button type="primary" size="small"
                               v-if="filterModel.trem_checkMemberTimes.minCheckMemberTime != '' && filterModel.trem_checkMemberTimes.maxCheckMemberTime != ''"
                               @click="confirmCheckMemberTimes()">
                        确定
                    </el-button>
                </el-form-item>
                <el-form-item label="背书瑕疵" v-if="this.templateSource != 'matchingQuote' && this.templateSource != 'memberQuery' && this.templateSource != 'orderManage' && this.templateSource != 'wantBill'">
                    <el-radio-group v-model="filterModel.flaw" size="small" @change="changeFlaw(filterModel.flaw)">
                        <el-radio-button v-for="item in flawOptions" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="背书瑕疵" v-if="this.templateSource == 'matchingQuote'">
                    <el-radio-group v-model="filterModel.flaw" size="small" @change="changeFlaw(filterModel.flaw)">
                        <el-radio-button v-for="item in matchFlawOptions" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="背书瑕疵" v-if="this.templateSource == 'wantBill'">
                    <el-radio-group v-model="filterModel.flaw" size="small" @change="changeFlaw(filterModel.flaw)">
                        <el-radio-button v-for="item in wantBillFlawTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="逾期审核" v-if="this.templateSource == 'billQuery'">
                    <el-radio-group v-model="filterModel.outTime" size="small" @change="changeOutTime(filterModel.outTime)">
                        <el-radio-button v-for="item in outTimeTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票据流向" v-if="this.templateSource == 'billQuery'">
                    <el-radio-group v-model="filterModel.billFlow" size="small" @change="changeBillFlow(filterModel.billFlow)">
                        <el-radio-button v-for="item in flowBillTypesOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="竞价方式" v-if="this.templateSource == 'matchingQuote'">
                    <el-radio-group v-model="filterModel.biddingMode" size="small" @change="changeBiddingMode(filterModel.biddingMode)">
                        <el-radio-button v-for="item in biddingModeOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="票据状态" v-if="this.templateSource == 'matchingQuote'">
                    <el-radio-group v-model="filterModel.billStatus" size="small" @change="changeBillStatus(filterModel.billStatus)">
                        <el-radio-button v-for="item in billStatusOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="是否首单" v-if="this.templateSource == 'matchingQuote' || this.templateSource == 'orderQuery'">
                    <el-radio-group v-model="filterModel.flistOrder" size="small" @change="changeflistOrder(filterModel.flistOrder)">
                        <el-radio-button v-for="item in flistOrderOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="是否审核" v-if="this.templateSource == 'matchingQuote'">
                    <el-radio-group v-model="filterModel.isCheckedCode" size="small" @change="changeisChecked(filterModel.isCheckedCode)">
                        <el-radio-button v-for="item in isCheckedOption" :label="item.key" :key="item.key">{{item.label}}</el-radio-button>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="买方价格" v-if="this.templateSource == 'matchingQuote'" class="bill_price_tem">
                    <el-input type="number" v-model="filterModel.billRate" class="bill_rate" placeholder="年利率" min="0"></el-input> % +
                    <el-input type="number" v-model="filterModel.everyPlus" class="every_plus" placeholder="每十万手续费" min="0"></el-input> 元
                    <el-popover
                            placement="right-start"
                            width="380"
                            trigger="hover"
                            content="如：输入5.0+60，筛选出可买入的票源，买卖差价可排序">
                        <span class="tips hpx-red-tips" slot="reference"><i class="iconfont icon-tishi"></i></span>
                    </el-popover>
                    <el-button type="primary" size="small"
                               v-if="filterModel.billRate != ''"
                               @click="confirmRate()">
                        确定
                    </el-button>
                    <el-button type="info" size="small"
                               v-if="filterModel.billRate != ''"
                               @click="clearRate()">
                        清空
                    </el-button>
                </el-form-item>
            </div>
            <div class="choose_tag_box">
                <el-form-item label="筛选条件" class="condition_tangs">
                    <el-tag
                    v-for="tag in tags"
                    :key="tag.name"
                    closable
                    disable-transitions
                    :type="tag.type"
                    size="small"
                    @close="closeTag(tag)">
                    {{tag.name}}
                    </el-tag>
                    <span v-if="tags.length == 0" class="hpx-label">无</span>
                    <span class="clear_filter" v-if="tags && tags.length != 0" @click="clearAllChoose()"><i class="iconfont icon-shanchu"></i> 清空筛选</span>
                </el-form-item>
            </div>
        </el-form>
    </div>
</template>

<script lang="ts">
    import { Vue, Component, Prop } from 'vue-property-decorator';
    import {
        acceptorTypes,
        billSourceTypes,
        billPriceTypes,
        deadTimeTypes,
        flawChooseTypes,
        matchFlawChooseTypes,
        biddingModeTypes,
        billStatusTypes,
        matchBillStatusTypes,
        flistOrderTypes,
        isCheckedTypes,
        billTypes,
        channelAgentTypes,
        salesmanAffiliationTypes,
        payerTypes,
        orderStatusTypes,
        billQueryBillSatausTypes,
        checkTimeTypes,
        outTimeTypes,
        flowBillTypes,
        queryBillSourceTypes,
        registerStageTypes,
        isXingyeAccountTypes,
        checkStatusTypes,
        checkMinutesTypes,
        createMinutesTypes,
        memberTypes,
        roleType,
        orderSourceTypes,
        wantBillFlawTypes,
        billAcceptorTypes} from '@/util/constantStatus';
    import _ from 'lodash';
    import moment from 'moment';
    import { mapState, mapMutations, mapGetters, mapActions } from 'vuex';
    @Component({
        computed: {
            ...mapState([
                'checkServer'
            ])
        },
        methods: {
            ...mapActions([
                'getCheckServer'
            ])
        }
    })
    export default class FiltrateTemplate extends Vue {
        @Prop() templateSource: string;
        @Prop() templateState: string;
        tags:any = []
        acceptorTypeArr = [''];
        oldChecked:any = []
        isInputPrice = false
        isInputTime = false
        isInputTimeCheck = false
        isInputMinutesCheck = false
        isInputMinutesCreate = false
        isInputCheckMemberTime = false
        filterModel = {
            billSource: '',
            orderSource: '',
            orderRole: '',
            acceptorType: '',
            billPrice: '',
            trem_billPrice: {
                minPrice: '',
                maxPrice: ''
            },
            deadTime: '',
            trem_deadTime: {
                minTime: '',
                maxTime: ''
            },
            checkTime: '',
            trem_checkTime: {
                minTimeCheck: '',
                maxTimeCheck: ''
            },
            checkMinute: '',
            trem_checkMinutes: {
                minMinutesCheck: '0',
                maxMinutesCheck: ''
            },
            createMinute: '',
            trem_createMinutes: {
                minMinutesCreate: '0',
                maxMinutesCreate: ''
            },
            checkMemberTime: '',
            trem_checkMemberTimes: {
                minCheckMemberTime: '0',
                maxCheckMemberTime: ''
            },
            flaw: '',
            biddingMode: '',
            billStatus: '801',
            flistOrder: '',
            isCheckedCode: '1',
            billRate: '',
            everyPlus: '',
            acceptor_name: '',
            billTypeId: '',
            billSumPrice: '',
            deadlineDays: '',
            channelAgent: '',
            salesmanAffiliation: '',
            userId: '',
            billStyleId: '',
            orderStatusId: '',
            billStatusQuery: '',
            outTime: '',
            billFlow: '',
            memberTypeId: '1',
            registerStage: '5',
            isXingyeAccount: '',
            checkStatus: ''
        }
        billSourceOptions = billSourceTypes; // 票据来源
        acceptOptions = acceptorTypes;       // 承兑机构
        billAcceptorTypesOptions = billAcceptorTypes;       // 票据审核。票据统计承兑机构筛选
        billPriceOption = billPriceTypes;    // 票面金额筛选
        deadTimeOption = deadTimeTypes;      // 到期时间筛选
        flawOptions = flawChooseTypes;       // 瑕疵情况（有瑕疵，无瑕疵）
        matchFlawOptions = matchFlawChooseTypes;   // 匹配报价（有无瑕疵）
        wantBillFlawTypesOption = wantBillFlawTypes;    // 求购录入（有无瑕疵）
        biddingModeOption = biddingModeTypes;  //竞价方式
        billStatusOption = matchBillStatusTypes;    // 票据状态
        flistOrderOption = flistOrderTypes;   // 是否首单
        isCheckedOption = isCheckedTypes;     // 是否审核
        billTypesOption = billTypes;                // 票据类型
        checkServerOption = []                        // 审核客服
        channelAgentOption = channelAgentTypes;      // 渠道代理
        salesmanAffiliationTypesOption = salesmanAffiliationTypes;      // 业务员归属
        payerTypesOptions = payerTypes;        // 支付方
        orderStatusTypesOptions = orderStatusTypes;     // 订单统计--票据状态
        billQueryBillSatausTypesOption = billQueryBillSatausTypes;  // 票据统计--票据状态
        checkTimeTypesOption = checkTimeTypes;      // 审核时间
        outTimeTypesOption = outTimeTypes;          // 票据统计--是否逾期审核
        flowBillTypesOption = flowBillTypes;        // 票据统计--票据流向
        memberTypesOption = memberTypes;            // 会员审核 -- 会员类型
        queryBillSourceTypesOption = queryBillSourceTypes;       // 票据统计--票据来源
        registerStageTypesOption = registerStageTypes;           // 会员统计--注册阶段
        isXingyeAccountTypesOption = isXingyeAccountTypes;       // 会员统计--账户类型
        checkStatusTypesOption = checkStatusTypes;               // 会员统计--审核状态
        checkMinutesTypesOption = checkMinutesTypes;             // 会员统计--审核时长
        createMinutesTypesOption = createMinutesTypes;                 // 会员统计--创建时间
        roleOptions = roleType;                                  // 订单管理 -- 买卖角色
        orderSourceOptions = orderSourceTypes;                   // 订单管理 -- 订单来源



        //点击不限时删除对应的标签
        deleteTags (variable:string) {
            let anotherTags = this.tags.filter((el, index) => {
                return el.variable !== variable
            })
            this.tags = anotherTags;
        }
        //比较两个数组的差异
        diff(arr1, arr2) {
            let newArr = [];
            let arr3 = [];
            for (let i=0;i<arr1.length;i++) {
                if(arr2.indexOf(arr1[i]) === -1)
                    arr3.push(arr1[i]);
            }
            let arr4 = [];
            for (let j=0;j<arr2.length;j++) {
                if(arr1.indexOf(arr2[j]) === -1)
                    arr4.push(arr2[j]);
            }
            newArr = arr3.concat(arr4);
            return newArr;
        }
        filterCondition = {
            billSource: '',
            orderSource: '',
            orderRole: '',
            //承兑机构
            acceptType: '',
            // 票面金额
            billPrice: { min: '', max: '', gtoe: false, ltoe: false },
            // 到期天数
            expiresDays: { min: '', max: '', gtoe: false, ltoe: false },
            checkTimes: { min: '', max: '', gtoe: false, ltoe: false },
            checkMinutes: { min: '', max: '', gtoe: false, ltoe: false, checkMinutesLabel: '' },
            createMinutes: { min: '', max: '', gtoe: false, ltoe: false, createMinutesLabel: '' },
            checkMemberTimes: { min: '', max: '', gtoe: false, ltoe: false, createMinutesLabel: '' },
            //背书瑕疵
            flaw: '',
            biddingMode: '',
            billStatus: '801',
            flistOrder: '',
            isCheckedCode: '1',
            hopePrice: { rate: '', everyPlus: '' },
            acceptor_name: '',
            keyWord: '',
            billTypeId: '',
            billSumPrice: '',
            deadlineDays: '',
            channelAgent: '',
            salesmanAffiliation: '',
            userId: '',
            billStyleId: '',
            orderStatusId: '',
            billStatusQuery: '',
            outTime: '',
            billFlow: '',
            memberTypeId: '1',
            registerStage: '5',
            isXingyeAccount: '',
            checkStatus: ''
        }
        //限制日期选择的最小值
        pickerOptions = {
            disabledDate(time) {
                return time.getTime() < Date.now()
            }
        }
        //由选项的key得出对应的label
        getCheckLabel (arr:any, value:string) {
            for(let i = 0;i<arr.length;i++){
                if(arr[i].key === value){
                    return arr[i].label
                }
            }
        }
        //生成筛选条件标签
        getConditionTag (label:string, variable:string) {
            let tag = {
                name: label,
                variable: variable,
                type: 'danger'
            }
            this.tags.push(tag)
        }
        xxx = 1
        //关闭标签
        closeTag (tag) {
            this.tags.splice(this.tags.indexOf(tag), 1)
            let variable = tag.variable
            switch (variable) {
                case 'acceptor_name':
                    this.filterModel.acceptor_name = ''
                    break;
                case 'billSumPrice':
                    this.filterModel.billSumPrice = ''
                    break;
                case 'deadlineDays':
                    this.filterModel.deadlineDays = ''
                    break;
                case 'acceptorType':
                    let deleteTag = this.templateSource == 'billCheck' || this.templateSource == 'billQuery' ? _.find(this.billAcceptorTypesOptions, (el)=> tag.name.indexOf(el.label)>-1) : _.find(this.acceptOptions, (el)=> tag.name.indexOf(el.label)>-1)
                    if(deleteTag){
                        this.acceptorTypeArr.forEach((item, index) => {
                            if(item === deleteTag.key){
                                this.acceptorTypeArr.splice(index,1)
                                if(this.acceptorTypeArr.length == 0){
                                    this.acceptorTypeArr = ['']
                                }
                            }
                        })
                    }
                    break;
                case 'billPrice':
                    this.filterModel.billPrice = ''
                    this.filterModel.trem_billPrice.minPrice = ''
                    this.filterModel.trem_billPrice.maxPrice = ''
                    this.isInputPrice = false
                    break;
                case 'expiresDays':
                    this.filterModel.deadTime = ''
                    this.filterModel.trem_deadTime.minTime = ''
                    this.filterModel.trem_deadTime.maxTime = ''
                    this.isInputTime = false
                    break;
                case 'checkTimes':
                    this.filterModel.checkTime = ''
                    this.filterModel.trem_checkTime.minTimeCheck = ''
                    this.filterModel.trem_checkTime.maxTimeCheck = ''
                    this.isInputTimeCheck = false
                    break;
                case 'checkMinutes':
                    this.filterModel.checkMinute = ''
                    this.filterModel.trem_checkMinutes.minMinutesCheck = '0'
                    this.filterModel.trem_checkMinutes.maxMinutesCheck = ''
                    this.isInputMinutesCheck = false
                    break;
                case 'createMinutes':
                    this.filterModel.createMinute = ''
                    this.filterModel.trem_createMinutes.minMinutesCreate = '0'
                    this.filterModel.trem_createMinutes.maxMinutesCreate = ''
                    this.isInputMinutesCreate = false
                    break;
                case 'checkMemberTimes':
                    this.filterModel.checkMemberTime = ''
                    this.filterModel.trem_checkMemberTimes.minCheckMemberTime = '0'
                    this.filterModel.trem_checkMemberTimes.maxCheckMemberTime = ''
                    this.isInputCheckMemberTime = false
                    break;
                case 'flaw':
                    this.filterModel.flaw = ''
                    break;
                case 'biddingMode':
                    this.filterModel.biddingMode = ''
                    break;
                case 'billStatus':
                    this.filterModel.billStatus = '801'
                    break;
                case 'flistOrder':
                    this.filterModel.flistOrder = ''
                    break;
                case 'isCheckedCode':
                    this.filterModel.isCheckedCode = '1'
                    break;
                case 'hopePrice':
                    this.filterModel.billRate = ''
                    this.filterModel.everyPlus = ''
                    break;
                case 'billTypeId':
                    this.filterModel.billTypeId = ''
                    break;
                case 'channelAgent':
                    this.filterModel.channelAgent = ''
                    break;
                case 'salesmanAffiliation':
                    this.filterModel.salesmanAffiliation = ''
                    break;
                case 'userId':
                    this.filterModel.userId = ''
                    break;
                case 'billStyleId':
                    this.filterModel.billStyleId = ''
                    break;
                case 'orderStatusId':
                    this.filterModel.orderStatusId = ''
                    break;
                case 'billStatusQuery':
                    this.filterModel.billStatusQuery = ''
                    break;
                case 'outTime':
                    this.filterModel.outTime = ''
                    break;
                case 'billFlow':
                    this.filterModel.billFlow = ''
                    break;
                case 'memberTypeId':
                    this.filterModel.memberTypeId = '1'
                    break;
                case 'registerStage':
                    this.filterModel.registerStage = '5'
                    break;
                case 'isXingyeAccount':
                    this.filterModel.isXingyeAccount = ''
                    break;
                case 'checkStatus':
                    this.filterModel.checkStatus = ''
                    break;
                case 'billSource':
                    this.filterModel.billSource = ''
                    break;
                case 'orderSource':
                    this.filterModel.orderSource = ''
                case 'orderRole':
                    this.filterModel.orderRole = ''
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('closeTagFun',filterForm)
        }
        get filterType() {
            return {
                billSource: `票据来源: ${this.filterCondition.billSource}`,
                orderSource: `订单来源：${this.filterCondition.orderSource}`,
                orderRole: `买卖角色：${this.filterCondition.orderRole}`,
                acceptType: `承兑机构:${this.filterCondition.acceptType}`,
                billPrice: `
                    票面金额:${this.filterCondition.billPrice.gtoe ? '[' : '('}
                    ${this.filterCondition.billPrice.min}万,
                    ${this.filterCondition.billPrice.max}万
                    ${this.filterCondition.billPrice.ltoe ? ']' : ')'}`,
                expiresDays: `到期天数:(${this.filterCondition.expiresDays.min}, ${this.filterCondition.expiresDays.max}天)`,
                checkTimes: `统计时间：(${this.filterCondition.checkTimes.min}, ${this.filterCondition.checkTimes.max})`,
                checkMinutes: !this.isInputMinutesCheck ? `审核时长：(${this.filterCondition.checkMinutes.checkMinutesLabel})` : `审核时长：(${this.filterCondition.checkMinutes.min}, ${this.filterCondition.checkMinutes.max})`,
                createMinutes: !this.isInputMinutesCreate ? `审核时长：(${this.filterCondition.createMinutes.createMinutesLabel})` : `创建时间：(${this.filterCondition.createMinutes.min}, ${this.filterCondition.createMinutes.max})`,
                checkMemberTimes: !this.isInputCheckMemberTime ? `审核时间：(${this.filterCondition.checkMemberTimes.createMinutesLabel})` : `审核时间：(${this.filterCondition.checkMemberTimes.min}, ${this.filterCondition.checkMemberTimes.max})`,
                flaw: `背书瑕疵: ${this.filterCondition.flaw}`,
                biddingMode: `竞价方式: ${this.filterCondition.biddingMode}`,
                billStatus: `票据状态: ${this.filterCondition.billStatus}`,
                flistOrder: `是否首单: ${this.filterCondition.flistOrder}`,
                isCheckedCode: `是否审核: ${this.filterCondition.isCheckedCode}`,
                hopePrice: `买方价格: 年化${this.filterCondition.hopePrice.rate}%${this.filterCondition.hopePrice.everyPlus == '' ? '' : '+' + this.filterCondition.hopePrice.everyPlus}`,
                keyWord: `关键字:${this.filterCondition.keyWord}`,
                billTypeId: `票据类型：${this.filterCondition.billTypeId}`,
                billSumPrice: `票面金额：${this.filterCondition.billSumPrice}`,
                deadlineDays: `到期日期：${this.filterCondition.deadlineDays}`,
                channelAgent: `渠道代理：${this.filterCondition.channelAgent}`,
                salesmanAffiliation: `业务员归属：${this.filterCondition.salesmanAffiliation}`,
                userId: this.templateSource == 'memberQuery' ? `审核客服：${this.filterCondition.userId}` : `订单处理人员：${this.filterCondition.userId}`,
                billStyleId: `支付方：${this.filterCondition.billStyleId}`,
                orderStatusId: `票据状态：${this.filterCondition.orderStatusId}`,
                billStatusQuery: `票据状态：${this.filterCondition.billStatusQuery}`,
                outTime: `审核逾期：${this.filterCondition.outTime}`,
                billFlow: `票据流向：${this.filterCondition.billFlow}`,
                memberTypeId: `会员类型：${this.filterCondition.memberTypeId}`,
                registerStage: `注册阶段：${this.filterCondition.registerStage}`,
                isXingyeAccount: `账户类型：${this.filterCondition.isXingyeAccount}`,
                checkStatus: `审核状态：${this.filterCondition.checkStatus}`
            }
        }
        checkMinutesText = this.filterCondition.checkMinutes.checkMinutesLabel
        // 切换票据来源
        changeSource (item: any){
            // this.filterModel.
            //筛选出当前选中选项的值
            let {label} = _.find(this.billSourceOptions,(e, i) => {
                return e.key == this.filterModel.billSource;
            })
            this.filterCondition.billSource = label
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'billSource')
            if(currentTag) {
                currentTag.name = this.filterType.billSource
            } else {
                this.getConditionTag(this.filterType.billSource, 'billSource')
            }
            //点击不限删除对应标签
            if(this.filterModel.billSource == ''){
                this.deleteTags('billSource')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeSourceFun',filterForm)
        }
        // 切换订单来源  orderSource
        changeOrderSource () {
            // this.filterModel.
            //筛选出当前选中选项的值
            let {label} = _.find(this.orderSourceOptions,(e, i) => {
                return e.key == this.filterModel.orderSource;
            })
            this.filterCondition.orderSource = label
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'orderSource')
            if(currentTag) {
                currentTag.name = this.filterType.orderSource
            } else {
                this.getConditionTag(this.filterType.orderSource, 'orderSource')
            }
            //点击不限删除对应标签
            if(this.filterModel.orderSource == ''){
                this.deleteTags('orderSource')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeOrderSourceFun',filterForm)
        }
        // 切换买卖角色 orderRole
        changeOrderRole () {
            // this.filterModel.
            //筛选出当前选中选项的值
            let {label} = _.find(this.roleOptions,(e, i) => {
                return e.key == this.filterModel.orderRole;
            })
            this.filterCondition.orderRole = label
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'orderRole')
            if(currentTag) {
                currentTag.name = this.filterType.orderRole
            } else {
                this.getConditionTag(this.filterType.orderRole, 'orderRole')
            }
            //点击不限删除对应标签
            if(this.filterModel.orderRole == ''){
                this.deleteTags('orderRole')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeOrderRoleFun',filterForm)
        }
        //切换承兑机构
        changeCheckboxFilter (item:any) {
            //如果点击不限，则取消其他选项
            if(item[item.length-1] == ''){
                this.acceptorTypeArr = ['']
                this.deleteTags('acceptorType')
            } else{
                // this.oldChecked = item  billAcceptorTypesOptions
                //点击取消了某个选项
                if(item.length < this.oldChecked.length){
                    //删除的承兑类型id
                    let deleteId = this.diff(Array.from(item), Array.from(this.oldChecked))
                    //删除的承兑类型name
                    let deleteStr = this.templateSource == 'billCheck' || this.templateSource == 'billQuery' ? this.getCheckLabel(this.billAcceptorTypesOptions,deleteId.join().toString()) : this.getCheckLabel(this.acceptOptions,deleteId.join().toString())
                    //删除的标签
                    let deleteTag = _.find(this.tags,(el) => el.name.indexOf(deleteStr)>-1)
                    if(deleteTag){
                        this.tags.splice(this.tags.indexOf(deleteTag),1)
                    }
                    this.oldChecked = item
                }else{
                    //新增选中了某个选项
                    this.oldChecked = item
                    //选中的类型
                    this.filterCondition.acceptType = this.templateSource == 'billCheck' || this.templateSource == 'billQuery' ? this.getCheckLabel(this.billAcceptorTypesOptions,item[item.length-1]) : this.getCheckLabel(this.acceptOptions,item[item.length-1])
                    this.getConditionTag(this.filterType.acceptType, 'acceptorType')
                }
                //点击其它选项，则取消“不限”的选中状态
                if(item.indexOf('')>-1){
                    item.splice(item.indexOf(''),1)
                    this.acceptorTypeArr = item
                }

                //取消了全部选项
                if(item.length == 0){
                    this.acceptorTypeArr = ['']
                    this.deleteTags('acceptorType')
                }
            }
            this.filterModel.acceptorType = this.acceptorTypeArr.join(',')
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeAcceptFun',filterForm)
        }
        //搜索关键字
        searchKeyword () {
            this.filterCondition.keyWord = this.filterModel.acceptor_name
            let currentTag = _.find(this.tags, el => el.variable === 'acceptor_name')
            if(currentTag) {
                currentTag.name = this.filterType.keyWord
            } else {
                this.getConditionTag(this.filterType.keyWord,'acceptor_name')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('searchKeywordFun',filterForm)
        }
        //清空关键字
        clearKeyword () {
            this.filterModel.acceptor_name = ''
            this.deleteTags('acceptor_name')
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('clearKeywordFun',filterForm)
        }
        // 输入票面金额
        searchPriceInt () {
            this.filterCondition.keyWord = this.filterModel.billSumPrice
            let currentTag = _.find(this.tags, el => el.variable === 'billSumPrice')
            if(currentTag) {
                currentTag.name = this.filterType.keyWord
            } else {
                this.getConditionTag(this.filterType.keyWord,'billSumPrice')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('searchBillSumPriceFun',filterForm)
        }
        // 清空输入的票面金额
        clearPriceInt () {
            this.filterModel.billSumPrice = ''
            this.deleteTags('billSumPrice')
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('clearBillSumPriceFun',filterForm)
        }
        //切换票面金额
        changePrice () {
            this.filterModel.trem_billPrice.minPrice = ''
            this.filterModel.trem_billPrice.maxPrice = ''
            this.isInputPrice = false
            //筛选出当前选中选项的值
            let { billPriceMin, billPriceMax, gtoe, ltoe} = _.find(this.billPriceOption,(e, i) => {
                return e.key == this.filterModel.billPrice;
            })
            this.filterCondition.billPrice.min = billPriceMin;
            this.filterCondition.billPrice.max = billPriceMax;
            this.filterCondition.billPrice.gtoe = gtoe;
            this.filterCondition.billPrice.ltoe = ltoe;
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'billPrice')
            if(currentTag) {
                currentTag.name = this.filterType.billPrice
            } else {
                this.getConditionTag(this.filterType.billPrice, 'billPrice')
            }
            //点击不限删除对应标签
            if(this.filterModel.billPrice == ''){
                this.deleteTags('billPrice')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changePriceFun',filterForm)
        }
        //确定输入票面金额
        confirmPrice () {
            //取消不限
            this.filterModel.billPrice = '-1'
            //选中输入的金额
            this.isInputPrice = true
            this.filterCondition.billPrice.min = this.filterModel.trem_billPrice.minPrice;
            this.filterCondition.billPrice.max = this.filterModel.trem_billPrice.maxPrice;
            this.filterCondition.billPrice.gtoe = true;
            this.filterCondition.billPrice.ltoe = true;
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'billPrice')
            if(currentTag) {
                currentTag.name = this.filterType.billPrice
            } else {
                this.getConditionTag(this.filterType.billPrice, 'billPrice')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changePriceConfirmFun',filterForm)
        }
        //清空票面金额
        clearPrice () {
            this.deleteTags('billPrice')
            this.filterModel.billPrice = ''
            this.isInputPrice = false
            this.filterModel.trem_billPrice.minPrice = ''
            this.filterModel.trem_billPrice.maxPrice = ''
            this.filterCondition.billPrice.max = ''
            this.filterCondition.billPrice.min = ''
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changePriceClearFun',filterForm)
        }
        //切换到期天数
        changeTime () {
            this.filterModel.trem_deadTime.minTime = ''
            this.filterModel.trem_deadTime.maxTime = ''
            this.isInputTime = false
            //筛选出当前选中选项的值
            let { expiresDayMin, expiresDayMax} = _.find(this.deadTimeOption, (e, i) => {
                return e.key == this.filterModel.deadTime;
            })
            this.filterCondition.expiresDays.min = expiresDayMin;
            this.filterCondition.expiresDays.max = expiresDayMax;
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'expiresDays')
            if(currentTag) {
                currentTag.name = this.filterType.expiresDays
            } else {
                this.getConditionTag(this.filterType.expiresDays, 'expiresDays')
            }
            //点击不限删除对应标签
            if(this.filterModel.deadTime == ''){
                this.deleteTags('expiresDays')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeTimeFun',filterForm)
        }
        //确定输入到期天数
        confirmDays () {
            this.filterModel.deadTime = '-1'
            this.isInputTime = true

            this.filterCondition.expiresDays.min = this.filterModel.trem_deadTime.minTime;
            this.filterCondition.expiresDays.max = this.filterModel.trem_deadTime.maxTime;

            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'expiresDays')
            if(currentTag) {
                currentTag.name = this.filterType.expiresDays
            } else {
                this.getConditionTag(this.filterType.expiresDays, 'expiresDays')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeTimeComfirmFun',filterForm)
        }
        //清空到期天数
        clearTime () {
            this.deleteTags('expiresDays')
            this.filterModel.deadTime = ''
            this.isInputTime = false
            this.filterModel.trem_deadTime.minTime = ''
            this.filterModel.trem_deadTime.maxTime = ''
            this.filterCondition.expiresDays.max = ''
            this.filterCondition.expiresDays.min = ''
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeTimeClearFun',filterForm)
        }
        // 切换审核时间
        changecheckTime () {
            this.filterModel.trem_checkTime.minTimeCheck = ''
            this.filterModel.trem_checkTime.maxTimeCheck = ''
            this.isInputTimeCheck = false
            //筛选出当前选中选项的值
            let { checkTimesMin, checkTimesMax} = _.find(this.checkTimeTypesOption, (e, i) => {
                return e.key == this.filterModel.checkTime;
            })
            this.filterCondition.checkTimes.min = checkTimesMin;
            this.filterCondition.checkTimes.max = checkTimesMax;
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'checkTimes')
            if(currentTag) {
                currentTag.name = this.filterType.checkTimes
            } else {
                this.getConditionTag(this.filterType.checkTimes, 'checkTimes')
            }
            //点击不限删除对应标签
            if(this.filterModel.checkTime == ''){
                this.deleteTags('checkTimes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckTimeFun',filterForm)
        }
        // 确定输入的审核时间
        confirmCheckTime () {
            this.filterModel.checkTime = '-1'
            this.isInputTimeCheck = true

            this.filterCondition.checkTimes.min = this.filterModel.trem_checkTime.minTimeCheck;
            this.filterCondition.checkTimes.max = this.filterModel.trem_checkTime.maxTimeCheck;

            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'checkTimes')
            if(currentTag) {
                currentTag.name = this.filterType.checkTimes
            } else {
                this.getConditionTag(this.filterType.checkTimes, 'checkTimes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckTimeComfirmFun',filterForm)
        }
        // 清空输入的审核时间
        clearCheckTime () {
            this.deleteTags('checkTimes')
            this.filterModel.checkTime = ''
            this.isInputTimeCheck = false
            this.filterModel.trem_checkTime.minTimeCheck = ''
            this.filterModel.trem_checkTime.maxTimeCheck = ''
            this.filterCondition.checkTimes.max = ''
            this.filterCondition.checkTimes.min = ''
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckTimeClearFun',filterForm)
        }
        // 切换审核时长
        changeCheckMinutes () {
            this.filterModel.trem_checkMinutes.minMinutesCheck = '0'
            this.filterModel.trem_checkMinutes.maxMinutesCheck = ''
            this.isInputMinutesCheck = false
            //筛选出当前选中选项的值
            let { checkMinutesMin, checkMinutesMax, checkMinutesLabel} = _.find(this.checkMinutesTypesOption, (e, i) => {
                return e.key == this.filterModel.checkMinute;
            })
            this.filterCondition.checkMinutes.min = checkMinutesMin;
            this.filterCondition.checkMinutes.max = checkMinutesMax;
            this.filterCondition.checkMinutes.checkMinutesLabel = checkMinutesLabel;
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'checkMinutes')
            if(currentTag) {
                currentTag.name = this.filterType.checkMinutes
            } else {
                this.getConditionTag(this.filterType.checkMinutes, 'checkMinutes')
            }
            //点击不限删除对应标签
            if(this.filterModel.checkMinute == ''){
                this.deleteTags('checkMinutes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changecheckMinuteFun',filterForm)
        }
        // 确定输入的审核时长
        confirmCheckMinutes () {
            this.filterModel.checkMinute = '-1'
            this.isInputMinutesCheck = true

            this.filterCondition.checkMinutes.min = this.filterModel.trem_checkMinutes.minMinutesCheck;
            this.filterCondition.checkMinutes.max = this.filterModel.trem_checkMinutes.maxMinutesCheck;

            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'checkMinutes')
            if(currentTag) {
                currentTag.name = this.filterType.checkMinutes
            } else {
                this.getConditionTag(this.filterType.checkMinutes, 'checkMinutes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckMinutesComfirmFun',filterForm)
        }
        // 清空输入的审核时长
        clearCheckMinutes () {
            this.deleteTags('checkMinutes')
            this.filterModel.checkMinute = ''
            this.isInputMinutesCheck = false
            this.filterModel.trem_checkMinutes.minMinutesCheck = '0'
            this.filterModel.trem_checkMinutes.maxMinutesCheck = ''
            this.filterCondition.checkMinutes.max = ''
            this.filterCondition.checkMinutes.min = ''
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckMinutesClearFun',filterForm)
        }
        // 创建审核时间
        changeCreateMinutes () {
            this.filterModel.trem_createMinutes.minMinutesCreate = '0'
            this.filterModel.trem_createMinutes.maxMinutesCreate = ''
            this.isInputMinutesCreate = false
            //筛选出当前选中选项的值
            let { createMinutesMin, createMinutesMax, createMinutesLabel} = _.find(this.createMinutesTypesOption, (e, i) => {
                return e.key == this.filterModel.createMinute;
            })
            this.filterCondition.createMinutes.min = createMinutesMin;
            this.filterCondition.createMinutes.max = createMinutesMax;
            this.filterCondition.createMinutes.createMinutesLabel = createMinutesLabel;
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'createMinutes')
            if(currentTag) {
                currentTag.name = this.filterType.createMinutes
            } else {
                this.getConditionTag(this.filterType.createMinutes, 'createMinutes')
            }
            //点击不限删除对应标签
            if(this.filterModel.createMinute == ''){
                this.deleteTags('createMinutes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCreateMinuteFun',filterForm)
        }
        // 确定输入的创建时间
        confirmCreateMinutes () {
            this.filterModel.createMinute = '-1'
            this.isInputMinutesCreate = true

            this.filterCondition.createMinutes.min = this.filterModel.trem_createMinutes.minMinutesCreate;
            this.filterCondition.createMinutes.max = this.filterModel.trem_createMinutes.maxMinutesCreate;

            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'createMinutes')
            if(currentTag) {
                currentTag.name = this.filterType.createMinutes
            } else {
                this.getConditionTag(this.filterType.createMinutes, 'createMinutes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCreateMinutesComfirmFun',filterForm)
        }
        // 清空输入的创建时间
        clearCreateMinutes () {
            this.deleteTags('createMinutes')
            this.filterModel.createMinute = ''
            this.isInputMinutesCheck = false
            this.filterModel.trem_createMinutes.minMinutesCreate = '0'
            this.filterModel.trem_createMinutes.maxMinutesCreate = ''
            this.filterCondition.createMinutes.max = ''
            this.filterCondition.createMinutes.min = ''
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCreateMinutesClearFun',filterForm)
        }
        // 会员查询 切换审核时间
        changeCheckMemberTimes () {
            this.filterModel.trem_checkMemberTimes.minCheckMemberTime = '0'
            this.filterModel.trem_checkMemberTimes.maxCheckMemberTime = ''
            this.isInputCheckMemberTime = false
            //筛选出当前选中选项的值
            let { createMinutesMin, createMinutesMax, createMinutesLabel} = _.find(this.createMinutesTypesOption, (e, i) => {
                return e.key == this.filterModel.checkMemberTime;
            })
            this.filterCondition.checkMemberTimes.min = createMinutesMin;
            this.filterCondition.checkMemberTimes.max = createMinutesMax;
            this.filterCondition.checkMemberTimes.createMinutesLabel = createMinutesLabel;
            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'checkMemberTimes')
            if(currentTag) {
                currentTag.name = this.filterType.checkMemberTimes
            } else {
                this.getConditionTag(this.filterType.checkMemberTimes, 'checkMemberTimes')
            }
            //点击不限删除对应标签
            if(this.filterModel.checkMemberTime == ''){
                this.deleteTags('checkMemberTimes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckMemberTimesFun',filterForm)
        }
        // 会员查询 确定输入的审核时间
        confirmCheckMemberTimes () {
            this.filterModel.checkMemberTime = '-1'
            this.isInputCheckMemberTime = true

            this.filterCondition.checkMemberTimes.min = this.filterModel.trem_checkMemberTimes.minCheckMemberTime;
            this.filterCondition.checkMemberTimes.max = this.filterModel.trem_checkMemberTimes.maxCheckMemberTime;

            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'checkMemberTimes')
            if(currentTag) {
                currentTag.name = this.filterType.checkMemberTimes
            } else {
                this.getConditionTag(this.filterType.checkMemberTimes, 'checkMemberTimes')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckMemberTimesComfirmFun',filterForm)
        }
        // 会员查询 清空输入的审核时间
        clearCheckMemberTimes () {
            this.deleteTags('checkMemberTimes')
            this.filterModel.checkMemberTime = ''
            this.isInputCheckMemberTime = false
            this.filterModel.trem_checkMemberTimes.minCheckMemberTime = '0'
            this.filterModel.trem_checkMemberTimes.maxCheckMemberTime = ''
            this.filterCondition.checkMemberTimes.max = ''
            this.filterCondition.checkMemberTimes.min = ''
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckMemberTimesClearFun',filterForm)
        }


        //切换背书瑕疵
        changeFlaw () {
            //筛选出当前选中选项的值
            if (this.templateSource == 'matchingQuote') {
                let {label} = _.find(this.matchFlawOptions,(e, i) => {
                    return e.key == this.filterModel.flaw;
                })
                this.filterCondition.flaw = label
            }else if (this.templateSource == 'wantBill') {
                let {label} = _.find(this.wantBillFlawTypesOption,(e, i) => {
                    return e.key == this.filterModel.flaw;
                })
                this.filterCondition.flaw = label
            }else {
                let {label} = _.find(this.flawOptions,(e, i) => {
                    return e.key == this.filterModel.flaw;
                })
                this.filterCondition.flaw = label
            }

            //如果已经存在同类型选项的标签
            let currentTag = _.find(this.tags,(el) => el.variable === 'flaw')
            if(currentTag) {
                currentTag.name = this.filterType.flaw
            } else {
                this.getConditionTag(this.filterType.flaw, 'flaw')
            }
            //点击不限删除对应标签
            if(this.filterModel.flaw == ''){
                this.deleteTags('flaw')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeFlawFun',filterForm)
        }
        //切换竞价方式
        changeBiddingMode () {
            let {label} = _.find(this.biddingModeOption,(e, i) => {
                return e.key == this.filterModel.biddingMode;
            })
            this.filterCondition.biddingMode = label;
            let currentTag = _.find(this.tags,el => el.variable === 'biddingMode')
            if(currentTag) {
                currentTag.name = this.filterType.biddingMode
            }else{
                this.getConditionTag(this.filterType.biddingMode, 'biddingMode')
            }
            if(this.filterModel.biddingMode == ''){
                this.deleteTags('biddingMode')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeBiddingModeFun',filterForm)
        }
        //切换票据状态
        changeBillStatus () {
            let {label} = _.find(this.billStatusOption,(e, i) => {
                return e.key === this.filterModel.billStatus
            })
            this.filterCondition.billStatus = label
            let currentTag = _.find(this.tags, el => el.variable === 'billStatus')
            if(currentTag){
                currentTag.name = this.filterType.billStatus
            }else{
                this.getConditionTag(this.filterType.billStatus, 'billStatus')
            }
            if(this.filterModel.billStatus == ''){
                this.deleteTags('billStatus')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeBillStatusFun',filterForm)
        }
        // 是否首单
        changeflistOrder () {
            let {label} = _.find(this.flistOrderOption,(e, i) => {
                return e.key === this.filterModel.flistOrder
            })
            this.filterCondition.flistOrder = label
            let currentTag = _.find(this.tags, el => el.variable === 'flistOrder')
            if(currentTag){
                currentTag.name = this.filterType.flistOrder
            }else{
                this.getConditionTag(this.filterType.flistOrder, 'flistOrder')
            }
            if(this.filterModel.flistOrder == ''){
                this.deleteTags('flistOrder')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeflistOrderFun',filterForm)
        }
        // 是否审核
        changeisChecked () {
            let {label} = _.find(this.isCheckedOption,(e, i) => {
                return e.key === this.filterModel.isCheckedCode
            })
            this.filterCondition.isCheckedCode = label
            let currentTag = _.find(this.tags, el => el.variable === 'isCheckedCode')
            if(currentTag){
                currentTag.name = this.filterType.isCheckedCode
            }else{
                this.getConditionTag(this.filterType.isCheckedCode, 'isCheckedCode')
            }
            if(this.filterModel.isCheckedCode == ''){
                this.deleteTags('isCheckedCode')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeisCheckedFun',filterForm)
        }
        // 逾期审核 outTime
        changeOutTime () {
            let {label} = _.find(this.outTimeTypesOption,(e, i) => {
                return e.key === this.filterModel.outTime
            })
            this.filterCondition.outTime = label
            let currentTag = _.find(this.tags, el => el.variable === 'outTime')
            if(currentTag){
                currentTag.name = this.filterType.outTime
            }else{
                this.getConditionTag(this.filterType.outTime, 'outTime')
            }
            if(this.filterModel.outTime == ''){
                this.deleteTags('outTime')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeOutTimeFun',filterForm)
        }
        // 票据流向
        changeBillFlow () {
            let {label} = _.find(this.flowBillTypesOption,(e, i) => {
                return e.key === this.filterModel.billFlow
            })
            this.filterCondition.billFlow = label
            let currentTag = _.find(this.tags, el => el.variable === 'billFlow')
            if(currentTag){
                currentTag.name = this.filterType.billFlow
            }else{
                this.getConditionTag(this.filterType.billFlow, 'billFlow')
            }
            if(this.filterModel.billFlow == ''){
                this.deleteTags('billFlow')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeBillFlowFun',filterForm)
        }
        // 会员类型
        changeMemberTypeId () {
            let {label} = _.find(this.memberTypesOption,(e, i) => {
                return e.key === this.filterModel.memberTypeId
            })
            this.filterCondition.memberTypeId = label
            let currentTag = _.find(this.tags, el => el.variable === 'memberTypeId')
            if(currentTag){
                currentTag.name = this.filterType.memberTypeId
            }else{
                this.getConditionTag(this.filterType.memberTypeId, 'memberTypeId')
            }
            if(this.filterModel.memberTypeId == ''){
                this.deleteTags('memberTypeId')
            }
            this.filterModel.channelAgent = ''
            this.filterCondition.channelAgent = ''
            this.deleteTags('channelAgent')

            this.filterModel.registerStage = '5'
            this.filterCondition.registerStage = '5'
            this.deleteTags('registerStage')

            this.filterModel.isXingyeAccount = ''
            this.filterCondition.isXingyeAccount = ''
            this.deleteTags('isXingyeAccount')

            this.filterModel.checkStatus = ''
            this.filterCondition.checkStatus = ''
            this.deleteTags('checkStatus')

            this.filterModel.userId = ''
            this.filterCondition.userId = ''
            this.deleteTags('userId')

            this.filterModel.checkMinute = ''           // 审核时长  checkMinutes: { min: '', max: '', gtoe: false, ltoe: false, checkMinutesLabel: '' }
            this.isInputMinutesCheck = false
            this.filterModel.trem_checkMinutes.minMinutesCheck = '0'
            this.filterModel.trem_checkMinutes.maxMinutesCheck = ''
            this.filterCondition.checkMinutes.min = ''
            this.filterCondition.checkMinutes.max = ''
            this.filterCondition.checkMinutes.gtoe = false
            this.filterCondition.checkMinutes.ltoe = false
            this.filterCondition.checkMinutes.checkMinutesLabel = ''
            this.deleteTags('checkMinutes')

            this.filterModel.checkMemberTime = ''         // 会员查询--审核时间
            this.isInputCheckMemberTime = false
            this.filterModel.trem_checkMemberTimes.minCheckMemberTime = '0'
            this.filterModel.trem_checkMemberTimes.maxCheckMemberTime = ''
            this.filterCondition.checkMemberTimes.min = ''
            this.filterCondition.checkMemberTimes.max = ''
            this.filterCondition.checkMemberTimes.gtoe = false
            this.filterCondition.checkMemberTimes.ltoe = false
            this.filterCondition.checkMemberTimes.createMinutesLabel = ''
            this.deleteTags('checkMemberTimes')

            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeMemberTypeIdFun',filterForm)
        }
        // 会员统计--注册阶段  registerStage
        changeRegisterStage () {
            let {label} = _.find(this.registerStageTypesOption,(e, i) => {
                return e.key === this.filterModel.registerStage
            })
            this.filterCondition.registerStage = label
            let currentTag = _.find(this.tags, el => el.variable === 'registerStage')
            if(currentTag){
                currentTag.name = this.filterType.registerStage
            }else{
                this.getConditionTag(this.filterType.registerStage, 'registerStage')
            }
            if(this.filterModel.registerStage == ''){
                this.deleteTags('registerStage')
            }
            this.filterModel.channelAgent = ''
            this.filterCondition.channelAgent = ''
            this.deleteTags('channelAgent')

            this.filterModel.isXingyeAccount = ''
            this.filterCondition.isXingyeAccount = ''
            this.deleteTags('isXingyeAccount')

            this.filterModel.checkStatus = ''
            this.filterCondition.checkStatus = ''
            this.deleteTags('checkStatus')

            this.filterModel.userId = ''
            this.filterCondition.userId = ''
            this.deleteTags('userId')

            this.filterModel.checkMinute = ''           // 审核时长  checkMinutes: { min: '', max: '', gtoe: false, ltoe: false, checkMinutesLabel: '' }
            this.isInputMinutesCheck = false
            this.filterModel.trem_checkMinutes.minMinutesCheck = '0'
            this.filterModel.trem_checkMinutes.maxMinutesCheck = ''
            this.filterCondition.checkMinutes.min = ''
            this.filterCondition.checkMinutes.max = ''
            this.filterCondition.checkMinutes.gtoe = false
            this.filterCondition.checkMinutes.ltoe = false
            this.filterCondition.checkMinutes.checkMinutesLabel = ''
            this.deleteTags('checkMinutes')

            this.filterModel.checkMemberTime = ''         // 会员查询--审核时间
            this.isInputCheckMemberTime = false
            this.filterModel.trem_checkMemberTimes.minCheckMemberTime = '0'
            this.filterModel.trem_checkMemberTimes.maxCheckMemberTime = ''
            this.filterCondition.checkMemberTimes.min = ''
            this.filterCondition.checkMemberTimes.max = ''
            this.filterCondition.checkMemberTimes.gtoe = false
            this.filterCondition.checkMemberTimes.ltoe = false
            this.filterCondition.checkMemberTimes.createMinutesLabel = ''
            this.deleteTags('checkMemberTimes')


            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeRegisterStageFun',filterForm)
        }
        // 账户类型  isXingyeAccount
        changeIsXingyeAccount () {
            let {label} = _.find(this.isXingyeAccountTypesOption,(e, i) => {
                return e.key === this.filterModel.isXingyeAccount
            })
            this.filterCondition.isXingyeAccount = label
            let currentTag = _.find(this.tags, el => el.variable === 'isXingyeAccount')
            if(currentTag){
                currentTag.name = this.filterType.isXingyeAccount
            }else{
                this.getConditionTag(this.filterType.isXingyeAccount, 'isXingyeAccount')
            }
            if(this.filterModel.isXingyeAccount == ''){
                this.deleteTags('isXingyeAccount')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeIsXingyeAccountFun',filterForm)
        }
        // 审核状态  checkStatus
        changeCheckStatus () {
            let {label} = _.find(this.checkStatusTypesOption,(e, i) => {
                return e.key === this.filterModel.checkStatus
            })
            this.filterCondition.checkStatus = label
            let currentTag = _.find(this.tags, el => el.variable === 'checkStatus')
            if(currentTag){
                currentTag.name = this.filterType.checkStatus
            }else{
                this.getConditionTag(this.filterType.checkStatus, 'checkStatus')
            }
            if(this.filterModel.checkStatus == ''){
                this.deleteTags('checkStatus')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeCheckStatusFun',filterForm)
        }
        //确定输入利率
        confirmRate () {
            this.filterCondition.hopePrice.rate = this.filterModel.billRate
            this.filterCondition.hopePrice.everyPlus = this.filterModel.everyPlus

            let currentTag = _.find(this.tags, el => el.variable === 'hopePrice')
            if(currentTag){
                currentTag.name = this.filterType.hopePrice
            }else{
                this.getConditionTag(this.filterType.hopePrice, 'hopePrice')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('confirmRateFun',filterForm)
        }
        //清空买方价格
        clearRate () {
            this.deleteTags('hopePrice')
            this.filterModel.billRate = ''
            this.filterModel.everyPlus = ''
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('clearRateFun',filterForm)
        }
        changeBillTypeId () {
            let {label} = _.find(this.billTypesOption,(e, i) => {
                return e.key === this.filterModel.billTypeId
            })
            this.filterCondition.billTypeId = label
            let currentTag = _.find(this.tags, el => el.variable === 'billTypeId')
            if(currentTag){
                currentTag.name = this.filterType.billTypeId
            }else{
                this.getConditionTag(this.filterType.billTypeId, 'billTypeId')
            }
            if(this.filterModel.billTypeId == ''){
                this.deleteTags('billTypeId')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeBillTypeIdFun',filterForm)
        }
        changeChannelAgent () {
            // channelAgent
            let {label} = _.find(this.channelAgentOption,(e, i) => {
                return e.key === this.filterModel.channelAgent
            })
            this.filterCondition.channelAgent = label
            let currentTag = _.find(this.tags, el => el.variable === 'channelAgent')
            if(currentTag){
                currentTag.name = this.filterType.channelAgent
            }else{
                this.getConditionTag(this.filterType.channelAgent, 'channelAgent')
            }
            if(this.filterModel.channelAgent == ''){
                this.deleteTags('channelAgent')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeChannelAgentFun',filterForm)
        }
        changeSalesmanAffiliation () {
            // salesmanAffiliation
            let {label} = _.find(this.salesmanAffiliationTypesOption,(e, i) => {
                return e.key === this.filterModel.salesmanAffiliation
            })
            this.filterCondition.salesmanAffiliation = label
            let currentTag = _.find(this.tags, el => el.variable === 'salesmanAffiliation')
            if(currentTag){
                currentTag.name = this.filterType.salesmanAffiliation
            }else{
                this.getConditionTag(this.filterType.salesmanAffiliation, 'salesmanAffiliation')
            }
            if(this.filterModel.salesmanAffiliation == ''){
                this.deleteTags('salesmanAffiliation')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeSalesmanAffiliationFun',filterForm)
        }
        changeUserId () {
            let {username} = _.find(this.checkServerOption,(e, i) => {
                return e.id === this.filterModel.userId
            })
            this.filterCondition.userId = username
            let currentTag = _.find(this.tags, el => el.variable === 'userId')
            if(currentTag){
                currentTag.name = this.filterType.userId
            }else{
                this.getConditionTag(this.filterType.userId, 'userId')
            }
            if(this.filterModel.userId == ''){
                this.deleteTags('userId')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeUserIdFun',filterForm)
        }
        changePayer () {
            let {label} = _.find(this.payerTypesOptions,(e, i) => {
                return e.key === this.filterModel.billStyleId
            })
            this.filterCondition.billStyleId = label
            let currentTag = _.find(this.tags, el => el.variable === 'billStyleId')
            if(currentTag){
                currentTag.name = this.filterType.billStyleId
            }else{
                this.getConditionTag(this.filterType.billStyleId, 'billStyleId')
            }
            if(this.filterModel.billStyleId == ''){
                this.deleteTags('billStyleId')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changePayerFun',filterForm)
        }
        changeOrderStatusId () {
            let {label} = _.find(this.orderStatusTypesOptions,(e, i) => {
                return e.key === this.filterModel.orderStatusId
            })
            this.filterCondition.orderStatusId = label
            let currentTag = _.find(this.tags, el => el.variable === 'orderStatusId')
            if(currentTag){
                currentTag.name = this.filterType.orderStatusId
            }else{
                this.getConditionTag(this.filterType.orderStatusId, 'orderStatusId')
            }
            if(this.filterModel.orderStatusId == ''){
                this.deleteTags('orderStatusId')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeOrderStatusIdFun',filterForm)
        }
        changeBillStatusQuery () {
            let {label} = _.find(this.billQueryBillSatausTypesOption,(e, i) => {
                return e.key === this.filterModel.billStatusQuery
            })
            this.filterCondition.billStatusQuery = label
            let currentTag = _.find(this.tags, el => el.variable === 'billStatusQuery')
            if(currentTag){
                currentTag.name = this.filterType.billStatusQuery
            }else{
                this.getConditionTag(this.filterType.billStatusQuery, 'billStatusQuery')
            }
            if(this.filterModel.billStatusQuery == ''){
                this.deleteTags('billStatusQuery')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeBillStatusQueryFun',filterForm)
        }
        changeDate () {
            if(this.filterModel.deadlineDays){
                this.filterCondition.deadlineDays = moment(this.filterModel.deadlineDays).format('YYYY-MM-DD')
                let currentTag = _.find(this.tags, el => el.variable === 'deadlineDays')
                if(currentTag) {
                    currentTag.name = this.filterType.deadlineDays
                } else {
                    this.getConditionTag(this.filterType.deadlineDays, 'deadlineDays')
                }
            }else{
                this.deleteTags('deadlineDays')
            }
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('changeDateFun',filterForm)
        }

        // 清空所有筛选
        clearAllChoose () {
            this.filterModel = {
                billSource: '',
                orderSource: '',
                orderRole: '',
                acceptorType: '',
                billPrice: '',
                trem_billPrice: {
                    minPrice: '',
                    maxPrice: ''
                },
                deadTime: '',
                trem_deadTime: {
                    minTime: '',
                    maxTime: ''
                },
                checkTime: '',
                trem_checkTime: {
                    minTimeCheck: '',
                    maxTimeCheck: ''
                },
                checkMinute: '',
                trem_checkMinutes: {
                    minMinutesCheck: '0',
                    maxMinutesCheck: ''
                },
                createMinute: '',
                trem_createMinutes: {
                    minMinutesCreate: '0',
                    maxMinutesCreate: ''
                },
                checkMemberTime: '',
                trem_checkMemberTimes: {
                    minCheckMemberTime: '0',
                    maxCheckMemberTime: ''
                },
                flaw: '',
                biddingMode: '',
                billStatus: '801',
                flistOrder: '',
                isCheckedCode: '1',
                billRate: '',
                everyPlus: '',
                acceptor_name: '',
                billTypeId: '',
                billSumPrice: '',
                deadlineDays: '',
                channelAgent: '',
                salesmanAffiliation: '',
                userId: '',
                billStyleId: '',
                orderStatusId: '',
                billStatusQuery: '',
                outTime: '',
                billFlow: '',
                memberTypeId: '1',
                registerStage: '5',
                isXingyeAccount: '',
                checkStatus: ''
            }
            this.filterCondition = {
                billSource: '',
                orderSource: '',
                orderRole: '',
                //承兑机构
                acceptType: '',
                // 票面金额
                billPrice: { min: '', max: '', gtoe: false, ltoe: false },
                // 到期天数
                expiresDays: { min: '', max: '', gtoe: false, ltoe: false },
                checkTimes: { min: '', max: '', gtoe: false, ltoe: false },
                checkMinutes: { min: '', max: '', gtoe: false, ltoe: false, checkMinutesLabel: '' },
                createMinutes: { min: '', max: '', gtoe: false, ltoe: false, createMinutesLabel: '' },
                checkMemberTimes: { min: '', max: '', gtoe: false, ltoe: false, createMinutesLabel: '' },
                //背书瑕疵
                flaw: '',
                biddingMode: '',
                billStatus: '801',
                flistOrder: '',
                isCheckedCode: '1',
                hopePrice: { rate: '', everyPlus: '' },
                acceptor_name: '',
                keyWord: '',
                billTypeId: '',
                billSumPrice: '',
                deadlineDays: '',
                channelAgent: '',
                salesmanAffiliation: '',
                userId: '',
                billStyleId: '',
                orderStatusId: '',
                billStatusQuery: '',
                outTime: '',
                billFlow: '',
                memberTypeId: '1',
                registerStage: '5',
                isXingyeAccount: '',
                checkStatus: ''
            }
            this.tags = []
            this.acceptorTypeArr = ['']
            this.isInputPrice = false
            this.isInputTime = false
            this.isInputTimeCheck = false
            this.isInputCheckMemberTime = false
            this.isInputMinutesCreate = false
            this.isInputMinutesCheck = false
            let filterForm = {
                filterModel: this.filterModel,
                filterCondition: this.filterCondition
            }
            this.$emit('clearAllChooseFun',filterForm)
        }
        created () {
            let promise = this.getCheckServer()
            promise.then(resolve => {
                let arrCheck = {
                    id: '',
                    username: '不限'
                }
                this.checkServerOption = this.checkServer;
                this.checkServerOption.unshift(arrCheck)
            })
        }
        mounted () {

        }
    }
</script>

<style lang="scss" scoped>
    .clear_filter_btn {
        /*text-align: right;*/
        /*padding-right: 12px;*/
        /*height: 30px;*/
        position: absolute;
        right: 10px;
        bottom: 4px;
        .el-button {
            padding: 0;
        }
    }
    .filter_box {
        border-radius: 4px;
        padding-top: 16px;
        border: 1px solid $__color-border;
        .el-form-item {
            margin-bottom: 8px;
        }
    }
    .filter_box_con {
        position: relative;
        padding-bottom: 12px;
        .el-button--small {
            height: 32px;
        }
    }
    .bill_rate{
        width: 88px;
    }
    .every_plus{
        width: 124px;
    }
    .tips{
        margin: 0 12px;
        cursor: pointer;
        width: 16px;
        height: 16px;
    }
    .hpx-red-tips {
        color: $__color-remind;
    }
    .choose_tag_box {
        border-top: 1px solid $__color-line;
        .el-form-item {
            margin-bottom: 0 !important;
        }
        .el-tag--small {
            margin-right: 4px;
        }
    }
</style>
<style lang="scss">
    .nowrap{
        white-space:nowrap;
        .bill_price{
            margin-top: -4px !important;
            .el-radio-button:last-child .el-radio-button__inner{
                border-radius: 0 !important;
            }
        }
        .ready_bill_price{
            display: inline-block;
            height: 32px;
            padding: 0 15px !important;
            border: 1px solid #dcdfe6;
            color: #606266;
            border-radius: 0px 4px 4px 0 !important;
            border-left: none;
            margin-left: -4px !important;
            .el-input{
                width: 35px;
                .el-input__inner{
                    padding: 0 2px !important;
                    height: 22px;
                    border: none;
                }
            }
            input::-webkit-outer-spin-button,
            input::-webkit-inner-spin-button{
                -webkit-appearance: none !important;
            }
            input[type="number"]{
                -moz-appearance:textfield;
            }
        }
    }
    .is_active{
        color: #fff !important;
        background-color: $__color-primary;
        box-shadow: -1px 0 0 0 $__color-primary;
        border-color: $__color-primary !important;
        .el-input{
            .el-input__inner{
                background-color: $__color-primary;
                color: #fff;
            }
        }
    }
    .my_bill_form {
        .filter_bottom {
            .el-form-item__content {
                line-height: 40px;
            }
            border-top: 1px solid $__color-line;
            .el-form-item {
                padding-left: 60px;
            }
        }
        .el-form-item__content {
            line-height: 34px;
        }
        .el-form-item__label {
            line-height: 34px;
        }
        margin-top: 14px;
    }
    .my_bill_form_one {
        margin-top: 0 !important;
    }
    .bill_price_tem {
        .el-input__inner {
            height: 34px;
            line-height: 34px;
        }
    }
    .match_quote_keyword {
        .el-input {
            width: 380px;
            .el-input__inner {
                border-bottom-right-radius: 0;
                border-top-right-radius: 0;
            }
        }
        .el-button--primary {
            border-bottom-left-radius: 0;
            border-top-left-radius: 0;
        }
    }
    .want_bill_wanyuan_icon {
        .el-input__suffix {
            left: 290px;
        }
    }
    .want_bill_price_choose_int_width {
        .el-input {
            width: 320px !important;
        }
    }
    .keyword_int_height {
        .el-input__inner {
            height: 32px;
        }
    }
</style>